from manimlib import *

sys.path.append('.')
from customized import *


class p1(ThreeDScene):
    def construct(self):
        # self.camera.frame.save_state()
        # self.add(NumberPlane())
        # self.camera.frame.rotate(13*DEGREES,about_point=[0.0, 0.0, 1.0])
        s = Square(6).stretch(0.7, 0).set_color(BLACK)
        a, b, c, d = s.get_boundary_point(UL), s.get_boundary_point(UR), s.get_boundary_point(DR), s.get_boundary_point(
            DL)
        p = [-1, -2.5, 0]
        pa, pb, pc, pd = CustomizedLine(p, a), CustomizedLine(p, b), CustomizedLine(p, c), CustomizedLine(p, d)
        e, f = [1, 1, 0], [1, -1, 0]
        self.add(s, pa, pb, pc, pd,
                 CustomizedTex('A').next_to(s, UL),
                 CustomizedTex('B').next_to(s, UR),
                 CustomizedTex('C').next_to(s, DR),
                 CustomizedTex('D').next_to(s, DL),
                 CustomizedTex('P').next_to(p, UR).shift(RIGHT*0.1),
                 )


class p2(ThreeDScene):
    def construct(self):
        # self.camera.frame.save_state()
        # self.add(NumberPlane())
        # self.camera.frame.rotate(13*DEGREES,about_point=[0.0, 0.0, 1.0])
        s = Square(6).stretch(0.7, 0).set_color(BLACK)
        a, b, c, d = s.get_boundary_point(UL), s.get_boundary_point(UR), s.get_boundary_point(DR), s.get_boundary_point(
            DL)
        p = [-1, -2.5, 0]
        pa, pb, pc, pd = CustomizedLine(p, a), CustomizedLine(p, b), CustomizedLine(p, c), CustomizedLine(p, d)
        e, f = [-1, 3, 0], [-1, -3, 0]
        self.add(s, pa, pb, pc, pd,
                 CustomizedTex('A').next_to(s, UL),
                 CustomizedTex('B').next_to(s, UR),
                 CustomizedTex('C').next_to(s, DR),
                 CustomizedTex('D').next_to(s, DL),
                 CustomizedTex('P').next_to(p, UR).shift(RIGHT*0.1),
                 DashedLine(e, f).set_color(BLACK),
                 CustomizedTex('E').next_to(e, UP),
                 CustomizedTex('F').next_to(f, DOWN)
                 )
